import { TranslationWidth } from '@angular/common';
import { Component, OnInit } from '@angular/core';
import { AxiosService } from '../../axios.service';

@Component({
  selector: 'app-paibanset',
  templateUrl: './paibanset.component.html',
  styleUrls: ['./paibanset.component.scss']
})
export class PaibansetComponent implements OnInit {
  value1;
  value2;
  value3;
  value4;
  value5;


  constructor(
    public axios: AxiosService,

  ) { }

  ngOnInit(): void {
    this.getlistdata();
  }
  getlistdata() {
    this.axios.axiosPost("QueryDailyWorkhour").then((data) => {
      console.log(data)
      if (data["result"]=="ok") {
        this.value1 = data["design"]
        this.value2 = data["code"]
        this.value3 = data["jiagong"]
        this.value4 = data["ercijiagong"]
        this.value5 = data["zuzhuang"]
      }
    })
  }
  // 清除信息
  delInput() {
    this.value1 = 0
    this.value2 = 0
    this.value3 = 0
    this.value4 = 0
    this.value5 = 0
  }
  // 保存信息
  save() {
    this.axios.axiosPost("UpdateDailyWorkhour",{"design":this.value1,"code":this.value2,"jiagong":this.value3,"ercijiagong":this.value4,"zuzhuang":this.value5}).then((data)=>{
      console.log(data)
    })
  }
}
